<div class="layuimini-container">
    <form id="app-form" class="layui-form layuimini-form">
        <div class="layui-form-item  layui-row layui-col-xs12">
            <label class="layui-form-label required">选择分类</label>
            <!-- <div class="layui-input-block">
                 <select name="cate_id" id="cateId"  lay-filter="buildingFilter" data-select="{:url('shop.category/getCate')}" data-fields="cate_id,cate_name"  ></select>
             </div> -->
               <div class="layui-input-block">
                        <input type="text" id="demo1" class="layui-input" readonly="readonly" name="cate_id">
                    </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">规格名</label>
            <div class="layui-input-block">
                <input type="text" name="title" class="layui-input" lay-verify="required" placeholder="请输入规格名" value="">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">规格值</label>
            <div class="layui-input-block flex-row tags" id="tags">
                <input type="text" name="" class="layui-input" placeholder="多个规格值空格生成" id="inputTags">
            </div>
            <input type="hidden" name="content" value="" id="content" lay-verify="required" placeholder="请输入规格值">
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-block">
                <input type="text" name="sort" class="layui-input"  placeholder="请输入排序" value="0">
            </div>
        </div>
        <div class="hr-line"></div>
        <div class="layui-form-item text-center">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>确认</button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
        </div>

    </form>
</div>
<link rel="stylesheet" type="text/css" href="__STATIC__/plugs/lay_cascader/cascader/cascader.css"/>
<script src="__STATIC__/plugs/lay_cascader/cascader/cascader.js"></script>
<script type="text/javascript">

   layui.config({
        base: '/static/plugs/layui-v2.5.6/lay/modules/',
    }).use(['inputTags'],function(){
        var inputTags = layui.inputTags;
        inputTags.render({
          elem:'#inputTags',//定义输入框input对象
          content: [],//默认标签
          aldaBtn: false,//是否开启获取所有数据的按钮
          done: function(value){ //回车后的回调
          }
        })   
      })
</script>
<script>
    var layer = layui.layer,
        form = layui.form,
        $=layui.jquery,
        upload = layui.upload;
        window.onload=cate
    function cate(){
          $.ajax({
                    url:"{:url('shop.category/getCate')}",
                    dataType: 'json',
                    contentType: "application/json",  
                    type: 'post',
                    success: function (data) {
              
                        layui.use('layCascader', function () {
                            var layCascader = layui.layCascader;
                            var demo1_1=   layCascader({
                                    elem: '#demo1',
                                    clearable:true,
                                    props:{
                                        multiple: false,
                                        label: 'cate_name',
                                        value: 'cate_id',
                                    },
                                    options: data.data,
                                });
                             
                            
                        });
                    }
                });
    }
    </script>